import { ApplyTypeEnum } from '@/enums/membershipEnum';
import { ThridTypeEnum } from '@/enums/loginEnum';
import { BehaviorCollectTypeEnum, BusinessFunctionTypeEnum, LikeTypeEnum } from '@/enums/publicModuleEnum';
import { type EnvVersion } from '@/hooks/core/useEnv';
import { type MemberTypeGetListItem } from './membership/types';
import type { ComponentType } from '@/components/Form/types';
import type { RegisterIdAppUserInfo } from './activity/types';
import type { IBusinessOpportunityList } from './businessOpportunities/type';

// 列表接口返回参数
export interface IResData<T = any> {
  records: T[];
  /** 总条数 */
  total: number;
  /** 当前页码 */
  current: number;
  /** 每页条数 */
  size: number;
  /** 总页数 */
  pages: number
}

// 分页参数
export interface IQuery {
  // 当前页
  current: number;
  // 每页条数
  size: number;
}

export type IModuleSub = {
  code: number;
  module: string;
};

export interface IAreaListResData {
  id: number;
  pid: number;
  pname: string;
  extName: string;
}

export interface IUploadImgFilesResData {
  imageId?: number;
  imagePathBig?: string;
  imagePathSmall?: string;
  urlDomain?: string;
  /** 文件本地临时地址 */
  tempFilePath?: string;
}

export interface IUploadFilesResData {
  fileId?: number;
  /** 文件cdn地址 */
  fileUrl?: string;
  /** 文件名称 */
  name?: string;
  urlDomain?: string;
  /** 文件本地临时地址 */
  tempFilePath?: string;
  /** 视频封面cdn地址 */
  imagePathSmall?: string;
  /** 视频缩略图临时文件路径 */
  thumbTempFilePath?: string;
}

export interface ISystemConfigRes {
  beginTime: string;
  configId: number;
  configKey: string;
  configName: string;
  configType: string;
  configValue: string;
  createBy: string;
  createTime: string;
  endTime: string;
  params: any;
  remark: string;
  searchValue: string;
  sortField: string;
  sortOrder: string;
  updateBy: string;
  updateTime: string;
}

export interface IMiniProgramCodeData {
  scene: string;
  page: string;
  check_path: boolean;
  env_version: EnvVersion;
  tripartiteName: 'mini_yjr';
  thridType: ThridTypeEnum;
  width?: string;
}

export interface IAreaDataResultItem {
  id: number;
  pid: number;
  extName: string;
  name: string;
  latitude: string
  longitude: string
  deep: number
}
export interface BehaviorLikeStatusData {
  /** 业务id */
  sourceId: number;
  /** 业务类型 */
  type: LikeTypeEnum;
}

export interface BehaviorBrowseSetResult {
  leadingAvatar: string;
  leaderId: number;
  leadingName: string;
  socialPosition: string;
  memberName: string;
  companyName: string;
  levelName: string;
  lastTime: string;
  applyType: ApplyTypeEnum;
}

export interface AppShareLogData {
  path: string;
  /** string json */
  query: string;
}
export interface AppShareLogResult {
  id: number
  path: string;
  /** string json */
  query: string
}

export interface TianyanchaSearchResult {
  //经营状态
  regStatus: string;
  //成立日期
  estiblishTime: string;
  //注册资本
  regCapital: string;
  //机构类型-1：公司；2：香港企业；3：社会组织；4：律所；5：事业单位；6：基金会；7-不存在法人、注册资本、统一社会信用代码、经营状态;8：台湾企业；9-新机构
  companyType: number;
  //匹配原因
  matchType: string;
  // 1-公司 2-人
  type: number;
  //法人
  legalPersonName: string;
  //注册号
  regNumber: string;
  //统一社会信用代码
  creditCode: string;
  //公司名
  name: string;
  //公司id
  id: number;
  //组织机构代码
  orgNumber: string;
  //省份
  base: string;
}

export interface IndustryAll {
  categoryMiddle: string;
  categoryBig: string;
  category: string;
  categorySmall: string;
}

export interface TianyanchaDetailSnapshotResult extends TianyanchaSearchResult {
  companyOrgType: string;
  regLocation: string;
  logo?: string;
  businessScope: string;
  phoneNumber?: string;
  websiteList?: string[];
  phoneList?: string[];
  socialStaffNum: number;
  percentileScore: number;
  industry: string;
  tags: string;
  industryAll: IndustryAll;
  regInstitute: string;
  businessUnit?: string;
  staffNumRange: string;
  forceTime: string;
}

export interface GetDownStatisticsListResult {
  allottedTime: string;
  count: number;
  id: number;
  logo: string;
  membershipFees: string;
  name: string;
}

export type ClassTypeListKey =
  | 'areaId'
  | 'distance'
  | 'typeId'
  | 'memberLevel'
  | 'industryId'
  | 'nationalIndustryId'
  | 'memberPost'
  | 'memberState'
  | 'hydw_jfzt'
  | 'memberGroup'
  | 'unitLevel'
  | 'applyType';

export interface ClassTypeListResult {
  key: ClassTypeListKey;
  list: MemberTypeGetListItem[];
  name: string;
}

export interface CreateURLlinkData {
  path: string
  query: string
}

export interface CustomFormItemTypeListResult {
  id: number
  name: string
  type: ComponentType
}

export interface ResourceConfigResult {
  title: string;
  icon: string;
  subtitle: string;
  path: string;
}

export interface IBehaviorCollectOperateData {
  type: BehaviorCollectTypeEnum,
  dataId: number
}

export interface IBehaviorCollectListData extends IQuery {
  type: BehaviorCollectTypeEnum,
}

export interface PublicityData {
  type: BusinessFunctionTypeEnum
}